home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 426-450 / disk_443 / dice / dice.lzh / include / assert.h next >
C/C++ Source or Header  |  1990-08-02  |  506b  |  29 lines

  1.  
  2. /*
  3.  *  ASSERT.H
  4.  *
  5.  *  (c)Copyright 1990, Matthew Dillon, All Rights Reserved
  6.  *
  7.  *  relatively optimized, takes advantage of GNU-cpp __BASE_FILE__ macro
  8.  *  allowing us to store the filename string once in a static decl.
  9.  */
  10.  
  11. #ifndef _ASSERT_H
  12. #define _ASSERT_H
  13.  
  14. static char *__BaseFile = __BASE_FILE__;
  15.  
  16. extern void __FailedAssert(char *, int);
  17.  
  18. #ifndef assert
  19. #ifdef NDEBUG
  20. #define assert(ignore)
  21. #else
  22. #define assert(exp)     if (!(exp)) __FailedAssert( __BaseFile, __LINE__);
  23. #endif
  24. #endif
  25.  
  26. #endif
  27.  
  28.  
  29.